package com.yanqu.road.server.cmd.activity.shushan;


import com.yanqu.road.pb.activity.ShuShanProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.manger.activity.shushan.ShuShanMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.ClientProtocol;
import com.yanqu.road.server.protocol.GameProtocol;

/**
 * @Description
 * @Author cwq
 * @Data 2022/1/20 15:28
 */
@Cmd(code = GameProtocol.S_SHUSHAN_EXIT, desc = "蜀山 离开蜀山")
public class ShuShanExitCmd extends AbstractCommand {
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        ShuShanMgr.exitSystem(player);
        ShuShanProto.ShuShanExitRespMsg.Builder builder = ShuShanProto.ShuShanExitRespMsg.newBuilder();
        builder.setRet(0);
        player.sendPacket(ClientProtocol.U_SHUSHAN_EXIT, builder);
    }

    @Override
    public void sendData(GamePlayer player) {
    }
}
